\documentclass[12pt, a4paper, oneside]{ctexart}
\usepackage{amsmath, amsthm, amssymb, bm, color, framed, graphicx, hyperref, mathrsfs}

\title{\vspace{-4cm}\textbf{课程作业}}
\author{杨泽天}
\date{\today}
\linespread{1.5}
\definecolor{shadecolor}{RGB}{241, 241, 255}
\newcounter{problemname}
\newenvironment{problem}{\begin{shaded}\stepcounter{problemname}\par\noindent\textbf{题目\arabic{problemname}. }}{\end{shaded}\par}
\newenvironment{solution}{\par\noindent\textbf{解答. }}{\par}
\newenvironment{note}{\par\noindent\textbf{题目\arabic{problemname}的注记. }}{\par}
\begin{document}

\maketitle

\begin{problem}
试求$f(x)=\sin{x}$ 在 $\left[ 0,\pi \right] $ 上的平均值
\end{problem}

\begin{solution}
    所求平均值为
    $$
        f(\xi) = \frac{1}{\pi}\int_{0}^{\pi} \sin{x} dx = -\frac{1}{\pi}\cos{x} \bigg|^\pi_0 = \frac{2}{\pi}
    $$
\end{solution}

\begin{problem}
若  $ \forall  \varepsilon \ge 0 $,$\exists M \ge 0$,$\forall n \ge M$
$$ \left| a_{n}-a \right| < \varepsilon  $$
$$  $$
\end{problem}


\end{document}